import { createRouter, createWebHistory } from 'vue-router'
import Home from '../components/Home.vue'
import Chat from '../components/Chat.vue'

const routes = [
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/chat',
        name: 'Chat',
        component: Chat
    },
    // 默认重定向
    {
        path: '/',
        redirect: '/home'
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router